# borrowed from http://mikewest.org/archive/working-with-subversion-file-properties

[
    # Setting text-type file properties
    "txt","markdown","textile",
    # Setting HTML/CSS file properties
    "html","css",
    # Setting image file properties  
    "gif","jpg","png"
].each do |extension|
    Dir.glob("**/*.#{extension}").each do |filename|
        case extension
        when
            "txt","markdown","textile"
        then
            puts "Setting eol-style, keywords on #{filename}"
            `svn propset svn:eol-style native "#{filename}"`
        when "gif" then
            puts "Setting mime-type on #{filename}"
            `svn propset svn:mime-type 'image/gif' "#{filename}"`
        when "jpg" then
            puts "Setting mime-type on #{filename}"
            `svn propset svn:mime-type 'image/jpeg' "#{filename}"`
        when "png" then
            puts "Setting mime-type on #{filename}"
            `svn propset svn:mime-type 'image/png' "#{filename}"`
        when "html" then
            puts "Setting mime-type on #{filename}"
            `svn propset svn:mime-type 'text/html' "#{filename}"`
        when "css" then
            puts "Setting mime-type on #{filename}"
            `svn propset svn:mime-type 'text/css' "#{filename}"`
        end
    end
end

#
#
# *.html = svn:mime-type=text/html
# *.css = svn:mime-type=text/css
